lib/gpg: Don't kill gpg-agent on newer gnupg
authorDan Nicholson <nicholson@endlessm.com>
Thu, 5 Sep 2019 18:20:04 +0000 (12:20 -0600)
committerAtomic Bot <atomic-devel@projectatomic.io>
Fri, 6 Sep 2019 18:04:05 +0000 (18:04 +0000)
commitd14472a7f04d02d392d2754cfb3cec881aadc704
tree673e34c57471b137e6743568d6e9dd3ee28c4a18
parent522d31b2d4604026f1c0a442887ca9d4b319e9cc
lib/gpg: Don't kill gpg-agent on newer gnupg

GnuPG 2.1.17 contains a bug fix so that `gpg-agent` is killed when the
entire GPG home directory is deleted[1]. If the host's GnuPG is new
enough, then we don't need to bother calling `gpg-connect-agent` to kill
the agent since it will be cleaned up on its own.

Get the GnuPG version from the GPGME OpenPGP engine info and parse it to
see if it matches this criteria.

1. https://dev.gnupg.org/T2756

Closes: #1915
Approved by: cgwalters
src/libotutil/ot-gpg-utils.c